<template>
    <div class="bigbox">
        <ETable :delelteAll="delCompanyAll" :isSearch="false" :editCompany="editCompany" :columns="columns"  :loadData="getCompanys" :delelte="delCompany" :isPage="true" :pageSize="[10,20,30]" ref="table" >
          <template #buttons="{delAll}">
            <el-button type="success" @click="router.push('/personel/position-add')">添加岗位</el-button>
            <el-button type="danger" @click="delAll">批量删除</el-button>
            
          </template>
          <template #operation="{row , del}">
            
                
                <el-button type="primary"  @click="EDITOR(row.id)"> 编辑 </el-button> 
            
            <el-button type="danger"   @click="del(row.id)">删除 </el-button>
            
          </template>
        </ETable>
    
    </div>
  </template>
  
  <script setup lang="ts">
  import  { editCompany,  delCompany,  getCompanys ,delCompanyAll } from '../../apis/post/post';
  import ETable, { type ColumnType } from '../../components/ETable.vue';
  import { reactive } from 'vue';
  import router from '@/router';




// const EDITOR=(row:any)=>{
  
//   console.log(row);
// }

const EDITOR=(id:number)=>{
router.push({path:'/personel/position-add',query:{id}})
 console.log(id);
}

  const columns= reactive<ColumnType[]>([
  {
    prop: 'id',
    label: '序号',
    width: '200',
  },
  {
    prop: 'name',
    label: '角色名称',
    width: '200',
  },
  {
    prop: 'accountCounts',
    label: '关联账号',
    width: '200',
  },
  {
    prop: 'addAccountName',
    label: '创建人',
    width: '200',
  },
  {
    prop: 'addTime',
    label: '创建时间',
    width: '200',
  },
  {
    prop: 'operation',
    label: '操作',
    slot: true,
    width: '',
  },
  ])
  </script>
  
  <style scoped>
  /* .bigbox{
    background-color: #fff;
    padding: 20px;
  } */
  .add{
    width: 20px;
    color: #fff;
  }
  </style>